<?php
require_once FW_DIR_FRAMEWORK_VENDOR.DS.'HTMLSafe'.DS.'Safe.php';

/**
 * XSS Filter - HTML Source
 *
 * <code>
 * $sHtml = utilXssHtml::filter(array('object', 'embed'));
 * </code>
 *
 * @package util
 * @subpackage xss
 *
 * @author jylee3@simplexi.com
 * @version 1.0
 */
class utilXssHtml
{
    /**
     * HTML Safe Instance
     *
     * <code>
     * $sHtml = utilXssHtml::filter(array('object', 'embed'));
     * </code>
     *
     * @param    String    $sHtml
     * @param    Array    $aAllowTag
     *
     * @return    String
     */
    public static function filter($sHtml, $aAllowTag=array())
    {
        /* @var $htmlSafe HTML_Safe */
        $htmlSafe = utilSplClass::load('HTML_Safe');
        $htmlSafe->setAllowTags($aAllowTag);
        $sHtml = $htmlSafe->parse($sHtml);

        return htmlspecialchars($sHtml);
    }
}
